#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    bool isAnagram(string s, string t) {
        if (s.size() != t.size())
            return false;

        map<char, int> m1, m2;
        for (int i = 0; i < s.size(); ++i)
        {
            m1[s[i]]++;
            m2[t[i]]++;
        }

        for (int i = 0; i < m1.size(); ++i)
        {
            if (m1[i] != m2[i])  return false;
        }
        return true;
    }
};